package com.cskaoyan._01btyestream.copy;

import com.cskaoyan.utils.FileUtils;

import java.io.*;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/18 9:51
 **/

public class Demo2 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream in =
                new BufferedInputStream(new FileInputStream("D:\\aa.mp4"));
        BufferedOutputStream out =
                new BufferedOutputStream(new FileOutputStream("copy_aa.mp4"));

        long start = System.currentTimeMillis();
        // 利用工具类方法
        // FileUtils.copy1(in, out);
        FileUtils.copy2(in, out);



        long end = System.currentTimeMillis();

        System.out.println(end - start + "ms");
    }
}
